<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Model Protocol Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset="utf-8">
    <script src="../js/jquery.min.js" defer></script>
    <script src="../js/jazzy.js" defer></script>
    
    <script src="../js/lunr.min.js" defer></script>
    <script src="../js/typeahead.jquery.js" defer></script>
    <script src="../js/jazzy.search.js" defer></script>
  </head>
  <body>

    <a name="//apple_ref/swift/Protocol/Model" class="dashAnchor"></a>

    <a title="Model Protocol Reference"></a>

    <header class="header">
      <p class="header-col header-col--primary">
        <a class="header-link" href="../index.html">
          SwiftKueryORM Docs
        </a>
         (97% documented)
      </p>
    
      <p class="header-col--secondary">
        <form role="search" action="../search.json">
          <input type="text" placeholder="Search documentation" data-typeahead>
        </form>
      </p>
    
        <p class="header-col header-col--secondary">
          <a class="header-link" href="https://github.com/IBM-Swift/Swift-Kuery-ORM">
            <img class="header-icon" src="../img/gh.png"/>
            View on GitHub
          </a>
        </p>
    
    </header>

    <p class="breadcrumbs">
      <a class="breadcrumb" href="../index.html">SwiftKueryORM Reference</a>
      <img class="carat" src="../img/carat.png" />
      Model Protocol Reference
    </p>

    <div class="content-wrapper">
      <nav class="navigation">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/Database.html">Database</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/DatabaseDecoder.html">DatabaseDecoder</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes/DatabaseEncoder.html">DatabaseEncoder</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Classes.html#/s:13SwiftKueryORM9TableInfoC">TableInfo</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/RequestError.html">RequestError</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Protocols/Model.html">Model</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Typealiases.html">Type Aliases</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:13SwiftKueryORM21ConnectionPoolOptionsa">ConnectionPoolOptions</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:13SwiftKueryORM14ExclusiveRangea">ExclusiveRange</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:13SwiftKueryORM11GreaterThana">GreaterThan</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:13SwiftKueryORM18GreaterThanOrEquala">GreaterThanOrEqual</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:13SwiftKueryORM14InclusiveRangea">InclusiveRange</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:13SwiftKueryORM9LowerThana">LowerThan</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:13SwiftKueryORM16LowerThanOrEquala">LowerThanOrEqual</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:13SwiftKueryORM8Orderinga">Ordering</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:13SwiftKueryORM10Paginationa">Pagination</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:13SwiftKueryORM11QueryParamsa">QueryParams</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:13SwiftKueryORM12RequestErrora">RequestError</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Typealiases.html#/s:13SwiftKueryORM11SQLDataTypea">SQLDataType</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">

        <section class="section">
          <div class="section-content">
            <h1>Model</h1>
              <div class="declaration">
                <div class="language">
                  <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">Model</span><span class="p">:</span> <span class="kt">Codable</span></code></pre>

                </div>
              </div>
            <p>Protocol Model conforming to Codable defining the available operations</p>

          </div>
        </section>

        <section class="section">
          <div class="section-content">
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP9tableNameSSvpZ"></a>
                    <a name="//apple_ref/swift/Variable/tableName" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP9tableNameSSvpZ">tableName</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Defines the tableName in the Database</p>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        <p>Defaults to the name of the model + <q>s</q></p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">static</span> <span class="k">var</span> <span class="nv">tableName</span><span class="p">:</span> <span class="kt">String</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP12idColumnNameSSvpZ"></a>
                    <a name="//apple_ref/swift/Variable/idColumnName" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP12idColumnNameSSvpZ">idColumnName</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Defines the id column name in the Database</p>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        <p>Defaults to <q>id</q></p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">static</span> <span class="k">var</span> <span class="nv">idColumnName</span><span class="p">:</span> <span class="kt">String</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP12idColumnType0aB007SQLDataG0_pXpvpZ"></a>
                    <a name="//apple_ref/swift/Variable/idColumnType" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP12idColumnType0aB007SQLDataG0_pXpvpZ">idColumnType</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Defines the id column type in the Database</p>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        <p>Defaults to Int64</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">static</span> <span class="k">var</span> <span class="nv">idColumnType</span><span class="p">:</span> <span class="kt"><a href="../Typealiases.html#/s:13SwiftKueryORM11SQLDataTypea">SQLDataType</a></span><span class="o">.</span><span class="k">Type</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP9IDKeyPatha"></a>
                    <a name="//apple_ref/swift/Alias/IDKeyPath" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP9IDKeyPatha">IDKeyPath</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Defines typealias for the id fields keypath</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">typealias</span> <span class="kt">IDKeyPath</span> <span class="o">=</span> <span class="kt">WritableKeyPath</span><span class="o">&lt;</span><span class="k">Self</span><span class="p">,</span> <span class="kt">Int</span><span class="p">?</span><span class="o">&gt;</span><span class="p">?</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP9idKeypaths15WritableKeyPathCyxSiSgGSgvpZ"></a>
                    <a name="//apple_ref/swift/Variable/idKeypath" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP9idKeypaths15WritableKeyPathCyxSiSgGSgvpZ">idKeypath</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Defines the keypath to the Models id field</p>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">static</span> <span class="k">var</span> <span class="nv">idKeypath</span><span class="p">:</span> <span class="kt"><a href="../Protocols/Model.html#/s:13SwiftKueryORM5ModelP9IDKeyPatha">IDKeyPath</a></span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP15createTableSyncSbAA8DatabaseCSg5using_tKFZ"></a>
                    <a name="//apple_ref/swift/Method/createTableSync(using:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP15createTableSyncSbAA8DatabaseCSg5using_tKFZ">createTableSync(using:)</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Call to create the table in the database synchronously</p>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">createTableSync</span><span class="p">(</span><span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP11createTableyAA8DatabaseCSg5using_ySbSg_15KituraContracts12RequestErrorVSgtctFZ"></a>
                    <a name="//apple_ref/swift/Method/createTable(using:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP11createTableyAA8DatabaseCSg5using_ySbSg_15KituraContracts12RequestErrorVSgtctFZ">createTable(using:_:)</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Call to create the table in the database asynchronously</p>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">createTable</span><span class="p">(</span><span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?,</span> <span class="n">_</span> <span class="nv">onCompletion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">Bool</span><span class="p">?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP13dropTableSyncSbAA8DatabaseCSg5using_tKFZ"></a>
                    <a name="//apple_ref/swift/Method/dropTableSync(using:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP13dropTableSyncSbAA8DatabaseCSg5using_tKFZ">dropTableSync(using:)</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Call to drop the table in the database synchronously</p>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">dropTableSync</span><span class="p">(</span><span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP9dropTableyAA8DatabaseCSg5using_ySbSg_15KituraContracts12RequestErrorVSgtctFZ"></a>
                    <a name="//apple_ref/swift/Method/dropTable(using:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP9dropTableyAA8DatabaseCSg5using_ySbSg_15KituraContracts12RequestErrorVSgtctFZ">dropTable(using:_:)</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Call to drop the table in the database asynchronously</p>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">dropTable</span><span class="p">(</span><span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?,</span> <span class="n">_</span> <span class="nv">onCompletion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">Bool</span><span class="p">?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP4saveyAA8DatabaseCSg5using_yxSg_15KituraContracts12RequestErrorVSgtctF"></a>
                    <a name="//apple_ref/swift/Method/save(using:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP4saveyAA8DatabaseCSg5using_yxSg_15KituraContracts12RequestErrorVSgtctF">save(using:_:)</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Call to save a model to the database that accepts a completion
handler. The callback is passed a model or an error</p>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        <p>Undocumented</p>
<p>Undocumented</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">func</span> <span class="nf">save</span><span class="p">(</span><span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?,</span> <span class="n">_</span> <span class="nv">onCompletion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="k">Self</span><span class="p">?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP4saveyAA8DatabaseCSg5using_yqd__Sg_xSg15KituraContracts12RequestErrorVSgtctAK10IdentifierRd__lF"></a>
                    <a name="//apple_ref/swift/Method/save(using:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP4saveyAA8DatabaseCSg5using_yqd__Sg_xSg15KituraContracts12RequestErrorVSgtctAK10IdentifierRd__lF">save(using:_:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Call to save a model to the database that accepts a completion
handler. The callback is passed an id, a model or an error</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">func</span> <span class="n">save</span><span class="o">&lt;</span><span class="kt">I</span><span class="p">:</span> <span class="kt">Identifier</span><span class="o">&gt;</span><span class="p">(</span><span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?,</span> <span class="n">_</span> <span class="nv">onCompletion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">I</span><span class="p">?,</span> <span class="k">Self</span><span class="p">?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP6updateyqd__2id_AA8DatabaseCSg5usingyxSg_15KituraContracts12RequestErrorVSgtctAK10IdentifierRd__lF"></a>
                    <a name="//apple_ref/swift/Method/update(id:using:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP6updateyqd__2id_AA8DatabaseCSg5usingyxSg_15KituraContracts12RequestErrorVSgtctAK10IdentifierRd__lF">update(id:using:_:)</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Call to update a model in the database with an id that accepts a completion
handler. The callback is passed a updated model or an error</p>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">func</span> <span class="n">update</span><span class="o">&lt;</span><span class="kt">I</span><span class="p">:</span> <span class="kt">Identifier</span><span class="o">&gt;</span><span class="p">(</span><span class="nv">id</span><span class="p">:</span> <span class="kt">I</span><span class="p">,</span> <span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?,</span> <span class="n">_</span> <span class="nv">onCompletion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="k">Self</span><span class="p">?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP6deletey15KituraContracts10Identifier_p2id_AA8DatabaseCSg5usingyAE12RequestErrorVSgctFZ"></a>
                    <a name="//apple_ref/swift/Method/delete(id:using:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP6deletey15KituraContracts10Identifier_p2id_AA8DatabaseCSg5usingyAE12RequestErrorVSgctFZ">delete(id:using:_:)</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Call to delete a model in the database with an id that accepts a completion
handler. The callback is passed an optional error</p>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">delete</span><span class="p">(</span><span class="nv">id</span><span class="p">:</span> <span class="kt">Identifier</span><span class="p">,</span> <span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?,</span> <span class="n">_</span> <span class="nv">onCompletion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP9deleteAllyAA8DatabaseCSg5using_y15KituraContracts12RequestErrorVSgctFZ"></a>
                    <a name="//apple_ref/swift/Method/deleteAll(using:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP9deleteAllyAA8DatabaseCSg5using_y15KituraContracts12RequestErrorVSgctFZ">deleteAll(using:_:)</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Call to delete all the models in the database that accepts a completion
handler. The callback is passed an optional error</p>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">deleteAll</span><span class="p">(</span><span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?,</span> <span class="n">_</span> <span class="nv">onCompletion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP9deleteAllyAA8DatabaseCSg5using_qd__Sg8matchingy15KituraContracts12RequestErrorVSgctAK11QueryParamsRd__lFZ"></a>
                    <a name="//apple_ref/swift/Method/deleteAll(using:matching:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP9deleteAllyAA8DatabaseCSg5using_qd__Sg8matchingy15KituraContracts12RequestErrorVSgctAK11QueryParamsRd__lFZ">deleteAll(using:matching:_:)</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Call to delete all the models in the database mathcing the QueryParams that accepts a completion
handler. The callback is passed an optional error</p>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        <p>Delete all the models matching the QueryParams</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="n">deleteAll</span><span class="o">&lt;</span><span class="kt">Q</span><span class="p">:</span> <span class="kt"><a href="../Typealiases.html#/s:13SwiftKueryORM11QueryParamsa">QueryParams</a></span><span class="o">&gt;</span><span class="p">(</span><span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?,</span> <span class="n">matching</span> <span class="nv">queryParams</span><span class="p">:</span><span class="kt">Q</span><span class="p">?,</span> <span class="n">_</span> <span class="nv">onCompletion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP8getTable0aB00F0CyKFZ"></a>
                    <a name="//apple_ref/swift/Method/getTable()" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP8getTable0aB00F0CyKFZ">getTable()</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Call to get the table of the model</p>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">getTable</span><span class="p">()</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Table</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP4findyqd__2id_AA8DatabaseCSg5usingyxSg_15KituraContracts12RequestErrorVSgtctAK10IdentifierRd__lFZ"></a>
                    <a name="//apple_ref/swift/Method/find(id:using:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP4findyqd__2id_AA8DatabaseCSg5usingyxSg_15KituraContracts12RequestErrorVSgtctAK10IdentifierRd__lFZ">find(id:using:_:)</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Call to find a model in the database with an id that accepts a completion
handler. The callback is passed the model or an error</p>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        <p>Find a model with an id</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="n">find</span><span class="o">&lt;</span><span class="kt">I</span><span class="p">:</span> <span class="kt">Identifier</span><span class="o">&gt;</span><span class="p">(</span><span class="nv">id</span><span class="p">:</span> <span class="kt">I</span><span class="p">,</span> <span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?,</span> <span class="n">_</span> <span class="nv">onCompletion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="k">Self</span><span class="p">?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP7findAllyAA8DatabaseCSg5using_ySayxGSg_15KituraContracts12RequestErrorVSgtctFZ"></a>
                    <a name="//apple_ref/swift/Method/findAll(using:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP7findAllyAA8DatabaseCSg5using_ySayxGSg_15KituraContracts12RequestErrorVSgtctFZ">findAll(using:_:)</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Call to find all the models in the database that accepts a completion
handler. The callback is passed an array of models or an error</p>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        <p>Find all the models</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="nf">findAll</span><span class="p">(</span><span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?,</span> <span class="n">_</span> <span class="nv">onCompletion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">([</span><span class="k">Self</span><span class="p">]?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP7findAllyAA8DatabaseCSg5using_ySayqd___xtGSg_15KituraContracts12RequestErrorVSgtctAK10IdentifierRd__lFZ"></a>
                    <a name="//apple_ref/swift/Method/findAll(using:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP7findAllyAA8DatabaseCSg5using_ySayqd___xtGSg_15KituraContracts12RequestErrorVSgtctAK10IdentifierRd__lFZ">findAll(using:_:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Call to find all the models in the database that accepts a completion
handler. The callback is passed an array of tuples (id, model) or an error</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="n">findAll</span><span class="o">&lt;</span><span class="kt">I</span><span class="p">:</span> <span class="kt">Identifier</span><span class="o">&gt;</span><span class="p">(</span><span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?,</span> <span class="n">_</span> <span class="nv">onCompletion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">([(</span><span class="kt">I</span><span class="p">,</span> <span class="k">Self</span><span class="p">)]?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP7findAllyAA8DatabaseCSg5using_ys10DictionaryVyqd__xGSg_15KituraContracts12RequestErrorVSgtctAM10IdentifierRd__s8HashableRd__lFZ"></a>
                    <a name="//apple_ref/swift/Method/findAll(using:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP7findAllyAA8DatabaseCSg5using_ys10DictionaryVyqd__xGSg_15KituraContracts12RequestErrorVSgtctAM10IdentifierRd__s8HashableRd__lFZ">findAll(using:_:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Call to find all the models in the database that accepts a completion
handler. The callback is passed a dictionary [id: model] or an error</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="n">findAll</span><span class="o">&lt;</span><span class="kt">I</span><span class="p">:</span> <span class="kt">Identifier</span><span class="o">&gt;</span><span class="p">(</span><span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?,</span> <span class="n">_</span> <span class="nv">onCompletion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">([</span><span class="kt">I</span><span class="p">:</span> <span class="k">Self</span><span class="p">]?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP7findAllyAA8DatabaseCSg5using_qd__Sg8matchingySayxGSg_15KituraContracts12RequestErrorVSgtctAM11QueryParamsRd__lFZ"></a>
                    <a name="//apple_ref/swift/Method/findAll(using:matching:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP7findAllyAA8DatabaseCSg5using_qd__Sg8matchingySayxGSg_15KituraContracts12RequestErrorVSgtctAM11QueryParamsRd__lFZ">findAll(using:matching:_:)</a>
                    </code>
                      <span class="declaration-note">
                        Default implementation
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Call to find all the models in the database matching the QueryParams that accepts a completion
handler. The callback is passed an array of models or an error</p>

                      </div>
                      <h4>Default Implementation</h4>
                      <div class="default_impl abstract">
                        <p>Find all the models matching the QueryParams</p>
<p>Find all the models matching the QueryParams</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="n">findAll</span><span class="o">&lt;</span><span class="kt">Q</span><span class="p">:</span> <span class="kt"><a href="../Typealiases.html#/s:13SwiftKueryORM11QueryParamsa">QueryParams</a></span><span class="o">&gt;</span><span class="p">(</span><span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?,</span> <span class="n">matching</span> <span class="nv">queryParams</span><span class="p">:</span> <span class="kt">Q</span><span class="p">?,</span> <span class="n">_</span> <span class="nv">onCompletion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">([</span><span class="k">Self</span><span class="p">]?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP7findAllyAA8DatabaseCSg5using_qd__Sg8matchingySayqd_0__xtGSg_15KituraContracts12RequestErrorVSgtctAM11QueryParamsRd__AM10IdentifierRd_0_r0_lFZ"></a>
                    <a name="//apple_ref/swift/Method/findAll(using:matching:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP7findAllyAA8DatabaseCSg5using_qd__Sg8matchingySayqd_0__xtGSg_15KituraContracts12RequestErrorVSgtctAM11QueryParamsRd__AM10IdentifierRd_0_r0_lFZ">findAll(using:matching:_:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Call to find all the models in the database matching the QueryParams that accepts a completion
handler. The callback is passed an array of tuples (id, model) or an error</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="n">findAll</span><span class="o">&lt;</span><span class="kt">Q</span><span class="p">:</span> <span class="kt"><a href="../Typealiases.html#/s:13SwiftKueryORM11QueryParamsa">QueryParams</a></span><span class="p">,</span> <span class="kt">I</span><span class="p">:</span> <span class="kt">Identifier</span><span class="o">&gt;</span><span class="p">(</span><span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?,</span> <span class="n">matching</span> <span class="nv">queryParams</span><span class="p">:</span> <span class="kt">Q</span><span class="p">?,</span> <span class="n">_</span> <span class="nv">onCompletion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">([(</span><span class="kt">I</span><span class="p">,</span> <span class="k">Self</span><span class="p">)]?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelP7findAllyAA8DatabaseCSg5using_qd__Sg8matchingys10DictionaryVyqd_0_xGSg_15KituraContracts12RequestErrorVSgtctAO11QueryParamsRd__AO10IdentifierRd_0_s8HashableRd_0_r0_lFZ"></a>
                    <a name="//apple_ref/swift/Method/findAll(using:matching:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelP7findAllyAA8DatabaseCSg5using_qd__Sg8matchingys10DictionaryVyqd_0_xGSg_15KituraContracts12RequestErrorVSgtctAO11QueryParamsRd__AO10IdentifierRd_0_s8HashableRd_0_r0_lFZ">findAll(using:matching:_:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Call to find all the models in the database matching the QueryParams that accepts a completion
handler. The callback is passed a dictionary [id: model] or an error</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">static</span> <span class="kd">func</span> <span class="n">findAll</span><span class="o">&lt;</span><span class="kt">Q</span><span class="p">:</span> <span class="kt"><a href="../Typealiases.html#/s:13SwiftKueryORM11QueryParamsa">QueryParams</a></span><span class="p">,</span> <span class="kt">I</span><span class="p">:</span> <span class="kt">Identifier</span><span class="o">&gt;</span><span class="p">(</span><span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?,</span> <span class="n">matching</span> <span class="nv">queryParams</span><span class="p">:</span> <span class="kt">Q</span><span class="p">?,</span> <span class="n">_</span> <span class="nv">onCompletion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">([</span><span class="kt">I</span><span class="p">:</span> <span class="k">Self</span><span class="p">]?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelPAAE12executeQueryy0aB00F0_p5query_SayypSgG10parametersAA8DatabaseCSg5usingyxSg_15KituraContracts12RequestErrorVSgtctFZ"></a>
                    <a name="//apple_ref/swift/Method/executeQuery(query:parameters:using:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelPAAE12executeQueryy0aB00F0_p5query_SayypSgG10parametersAA8DatabaseCSg5usingyxSg_15KituraContracts12RequestErrorVSgtctFZ">executeQuery(query:parameters:using:_:)</a>
                    </code>
                      <span class="declaration-note">
                        Extension method
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Allows custom functions on a model to query the database directly.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">executeQuery</span><span class="p">(</span><span class="nv">query</span><span class="p">:</span> <span class="kt">Query</span><span class="p">,</span> <span class="nv">parameters</span><span class="p">:</span> <span class="p">[</span><span class="kt">Any</span><span class="p">?],</span> <span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="n">_</span> <span class="nv">onCompletion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="k">Self</span><span class="p">?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span> <span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>query</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The <code>Query</code> to execute</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>parameters</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>An optional array of parameters to pass to the query</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>using</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Optional Database to use</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>onCompletion</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The function to be called when the execution of the query has completed. The function will be passed a tuple of (Self?, RequestError?), of which one will be nil, depending on whether the query was successful.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelPAAE12executeQueryy0aB00F0_p5query_SayypSgG10parametersAA8DatabaseCSg5usingyqd__Sg_xSg15KituraContracts12RequestErrorVSgtctAQ10IdentifierRd__lFZ"></a>
                    <a name="//apple_ref/swift/Method/executeQuery(query:parameters:using:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelPAAE12executeQueryy0aB00F0_p5query_SayypSgG10parametersAA8DatabaseCSg5usingyqd__Sg_xSg15KituraContracts12RequestErrorVSgtctAQ10IdentifierRd__lFZ">executeQuery(query:parameters:using:_:)</a>
                    </code>
                      <span class="declaration-note">
                        Extension method
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Allows custom functions on a model to query the database directly.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="n">executeQuery</span><span class="o">&lt;</span><span class="kt">I</span><span class="p">:</span> <span class="kt">Identifier</span><span class="o">&gt;</span><span class="p">(</span><span class="nv">query</span><span class="p">:</span> <span class="kt">Query</span><span class="p">,</span> <span class="nv">parameters</span><span class="p">:</span> <span class="p">[</span><span class="kt">Any</span><span class="p">?],</span> <span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="n">_</span> <span class="nv">onCompletion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">I</span><span class="p">?,</span> <span class="k">Self</span><span class="p">?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span> <span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>query</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The <code>Query</code> to execute</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>parameters</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>An optional array of parameters to pass to the query</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>using</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Optional Database to use</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>onCompletion</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The function to be called when the execution of the query has completed. The function will be passed a tuple of (Identifier?, Self?, RequestError?), of which some will be nil, depending on whether the query was successful.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelPAAE12executeQueryy0aB00F0_p5query_SayypSgGSg10parametersAA8DatabaseCSg5usingySayxGSg_15KituraContracts12RequestErrorVSgtctFZ"></a>
                    <a name="//apple_ref/swift/Method/executeQuery(query:parameters:using:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelPAAE12executeQueryy0aB00F0_p5query_SayypSgGSg10parametersAA8DatabaseCSg5usingySayxGSg_15KituraContracts12RequestErrorVSgtctFZ">executeQuery(query:parameters:using:_:)</a>
                    </code>
                      <span class="declaration-note">
                        Extension method
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Allows custom functions on a model to query the database directly.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">executeQuery</span><span class="p">(</span><span class="nv">query</span><span class="p">:</span> <span class="kt">Query</span><span class="p">,</span> <span class="nv">parameters</span><span class="p">:</span> <span class="p">[</span><span class="kt">Any</span><span class="p">?]?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="n">_</span> <span class="nv">onCompletion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">([</span><span class="k">Self</span><span class="p">]?,</span> <span class="kt">RequestError</span><span class="p">?)</span><span class="o">-&gt;</span> <span class="kt">Void</span> <span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>query</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The <code>Query</code> to execute</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>parameters</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>An optional array of parameters to pass to the query</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>using</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Optional Database to use</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>onCompletion</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The function to be called when the execution of the query has completed. The function will be passed a tuple of ([Self]?, RequestError?), of which one will be nil, depending on whether the query was successful.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelPAAE12executeQueryy0aB00F0_p5query_SayypSgGSg10parametersAA8DatabaseCSg5usingySayqd___xtGSg_15KituraContracts12RequestErrorVSgtctAR10IdentifierRd__lFZ"></a>
                    <a name="//apple_ref/swift/Method/executeQuery(query:parameters:using:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelPAAE12executeQueryy0aB00F0_p5query_SayypSgGSg10parametersAA8DatabaseCSg5usingySayqd___xtGSg_15KituraContracts12RequestErrorVSgtctAR10IdentifierRd__lFZ">executeQuery(query:parameters:using:_:)</a>
                    </code>
                      <span class="declaration-note">
                        Extension method
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Allows custom functions on a model to query the database directly.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="n">executeQuery</span><span class="o">&lt;</span><span class="kt">I</span><span class="p">:</span> <span class="kt">Identifier</span><span class="o">&gt;</span><span class="p">(</span><span class="nv">query</span><span class="p">:</span> <span class="kt">Query</span><span class="p">,</span> <span class="nv">parameters</span><span class="p">:</span> <span class="p">[</span><span class="kt">Any</span><span class="p">?]?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="n">_</span> <span class="nv">onCompletion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">([(</span><span class="kt">I</span><span class="p">,</span> <span class="k">Self</span><span class="p">)]?,</span> <span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span> <span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>query</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The <code>Query</code> to execute</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>parameters</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>An optional array of parameters to pass to the query</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>using</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Optional Database to use</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>onCompletion</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The function to be called when the execution of the query has completed. The function will be passed a tuple of ([Identifier, Self]?, RequestError?), of which one will be nil, depending on whether the query was successful.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:13SwiftKueryORM5ModelPAAE12executeQueryy0aB00F0_p5query_SayypSgGSg10parametersAA8DatabaseCSg5usingy15KituraContracts12RequestErrorVSgctFZ"></a>
                    <a name="//apple_ref/swift/Method/executeQuery(query:parameters:using:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:13SwiftKueryORM5ModelPAAE12executeQueryy0aB00F0_p5query_SayypSgGSg10parametersAA8DatabaseCSg5usingy15KituraContracts12RequestErrorVSgctFZ">executeQuery(query:parameters:using:_:)</a>
                    </code>
                      <span class="declaration-note">
                        Extension method
                      </span>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Allows custom functions on a model to query the database directly.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">executeQuery</span><span class="p">(</span><span class="nv">query</span><span class="p">:</span> <span class="kt">Query</span><span class="p">,</span> <span class="nv">parameters</span><span class="p">:</span> <span class="p">[</span><span class="kt">Any</span><span class="p">?]?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="n">using</span> <span class="nv">db</span><span class="p">:</span> <span class="kt"><a href="../Classes/Database.html">Database</a></span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="n">_</span> <span class="nv">onCompletion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">RequestError</span><span class="p">?)</span> <span class="o">-&gt;</span> <span class="kt">Void</span> <span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>query</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The <code>Query</code> to execute</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>parameters</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>An optional array of parameters to pass to the query</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>using</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Optional Database to use</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>onCompletion</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The function to be called when the execution of the query has completed. The function will be passed a RequestError? which may be nil, depending on whether the query was successful.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </section>

      </article>
    </div>
    <section class="footer">
      <p>&copy; 2019 <a class="link" href="" target="_blank" rel="external">IBM</a>. All rights reserved. (Last updated: 2019-04-01)</p>
      <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.1</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
    </section>
  </body>
</div>
</html>
